IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spTfiles_Create')
	BEGIN
		PRINT 'Dropping Procedure spTfiles_Create'
		DROP  Procedure  spTfiles_Create
	END

GO

PRINT 'Creating Procedure spTfiles_Create'
GO
CREATE Procedure dbo.spTfiles_Create
	( 	  
	  @ILPNO char(20) = null, 
		@NBSNO char(20) = null, 
		@FTYPE char(20) = null, 
		@LOCNO char(10) = null, 
		@FSTATUS char(10) = null, 
		@FUSER char(8) = null, 
		@FEMPNO char(10) = null, 
		@FDATETIME DateTime = null, 
		@FTRANDTL char(80) = null, 
		@FCREATED DateTime = null, 
		@FCREATEDBY char(8) = null, 
		@FNOTES varchar(20) = null, 
		@FHOLD56 bit = null, 
		@FNOBD bit = null, 
		@FNOTD bit = null, 
		@FLBLPRT bit = null
	)
AS
  /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 9/6/2007    Initial version created
    ------------------------------------------------------------------------------
  */

	-- Declare the required variables

	-- Create the required new record
	INSERT INTO Tfiles
	  (
		ILPNO,
			NBSNO,
			FTYPE,
			LOCNO,
			FSTATUS,
			FUSER,
			FEMPNO,
			FDATETIME,
			FTRANDTL,
			FCREATED,
			FCREATEDBY,
			FNOTES,
			FHOLD56,
			FNOBD,
			FNOTD,
			FLBLPRT	  
	  )
	VALUES
	  (
		@ILPNO,
			@NBSNO,
			@FTYPE,
			@LOCNO,
			@FSTATUS,
			@FUSER,
			@FEMPNO,
			@FDATETIME,
			@FTRANDTL,
			@FCREATED,
			@FCREATEDBY,
			@FNOTES,
			@FHOLD56,
			@FNOBD,
			@FNOTD,
			@FLBLPRT
	  )

	-- Handle any errors
	IF @@ERROR != 0
	BEGIN
		RAISERROR('spTfiles_Create: Unable to Insert a new Tfiles', 10, 1)
		RETURN
	END

	-- Return the newly created ID
	SELECT	@@IDENTITY AS 'Tfiles_ID'

	-- Return to calling method
	RETURN 

GO
